<template>
	<view class="content">
		<image class="logo" src="/static/logo.png"></image>
		<view class="text-area">
			<view class="list-box">
				<view class="card-cell" v-for="(item, i) in pagesList" :key="i">
					<van-cell :title="item.label" is-link @click="gotoDetail(item)">
					</van-cell>
				</view>
			</view>
		</view>
		<HdFrom :lists="lists" />
	</view>
</template>

<script>
import pages from "uni-pages?{\"type\":\"style\"}";
import HdFrom from "@/components/dh-form/index.vue"
export default {
	data() {
		return {
			title: 'Hello',
			pagesList: [],
			lists: [{
				fieldType: "DhCell",
			}]
		}
	},
	onLoad() {
		this.init()
	},
	methods: {
		init(){
			let keyList = Object.keys(pages.pages)
			let valueList = Object.values(pages.pages)
			this.pagesList = keyList.map((e, i)=>{
				return {
					label: valueList[i].navigationBarTitleText,
					value: e
				}
			})
			console.log('this.pagesList', this.pagesList)
		},
		gotoDetail(item){
			uni.navigateTo({
				url: `/${item.value}`
			})
		}
	}
}
</script>

<style lang="scss" scoped>
.content {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
}
.list-box {
	margin: 0 5px;
	display: flex;
	flex-direction: column;
	flex-wrap: wrap;
}

.card-cell {
	margin: 5px;
	background: #fff;
	border-radius: 10px;
	padding: 10px;
}
</style>